const show = {
  state: {
    pages: [
      {
        name: 'Voice',
        show: false
      },
      {
        name: 'File',
        show: false
      },
      {
        name: 'Set',
        show: false
      }
    ]
  },
  mutations: {
    SHOW_PAGES: (state, data) => {
      let pages = data.map(item => {
        return item.name
      })
      state.pages.forEach(page => {
        if (pages.indexOf(page.name) > -1) {
          page.show = true
        }
      })
    }
  }
}

export default show
